<?php

/**
 * Distrib form base class.
 *
 * @package    alika
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseDistribForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'name'       => new sfWidgetFormInput(),
      'icon'       => new sfWidgetFormInput(),
      'type_id'    => new sfWidgetFormPropelChoice(array('model' => 'Typedistrib', 'add_empty' => false)),
      'created_at' => new sfWidgetFormDate(),
      'updated_at' => new sfWidgetFormDate(),
      'owner_id'   => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Distrib', 'column' => 'id', 'required' => false)),
      'name'       => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'icon'       => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'type_id'    => new sfValidatorPropelChoice(array('model' => 'Typedistrib', 'column' => 'id')),
      'created_at' => new sfValidatorDate(array('required' => false)),
      'updated_at' => new sfValidatorDate(array('required' => false)),
      'owner_id'   => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('distrib[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Distrib';
  }

  public function getI18nModelName()
  {
    return 'DistribI18n';
  }

  public function getI18nFormClass()
  {
    return 'DistribI18nForm';
  }

}
